package com.cicc.beergamevirtualsimulationsystem.common.exception;

/**
 * Base Exception is the parent of all exceptions
 *
 * @author sunny
 */
public abstract class BaseException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer errCode;
    private final transient Object[] parameters;

    public BaseException(String errMessage, Object... parameters) {
        super(errMessage);
        this.parameters = parameters;
    }

    public BaseException(Integer errCode, String errMessage, Object... parameters) {
        super(errMessage);
        this.errCode = errCode;
        this.parameters = parameters;
    }

    public BaseException(String errMessage, Throwable cause, Object... parameters) {
        super(errMessage, cause);
        this.parameters = parameters;
    }

    public BaseException(Integer errCode, String errMessage, Throwable cause, Object... parameters) {
        super(errMessage, cause);
        this.errCode = errCode;
        this.parameters = parameters;
    }

    public Integer getErrCode() {
        return errCode;
    }


    public Object[] getParameters() {
        return parameters;
    }
}
